#ifndef __ARCHIVE_H__
#define __ARCHIVE_H__

#include <string>
#include "Stream.h"

class IList 
{
public:
	virtual int GetSize() = 0;
};

//An empty class used to do as a friend of all class need to be serialized and deserialized
class Archive{};

template<typename Stream>
class ArchiveImplBase : public Archive
{
	typedef enum SERIALIZE_DIRECTION
	{
		OP_NONE = 0,
		OP_SERIALIZE = 1,
		OP_DESERIALIZE = 2
	};
public:
	template<typename T>
	ArchiveImplBase<Stream>& operator >> (T& data);

	template<typename T>
	ArchiveImplBase<Stream>& operator << (T& data);
	
	template<typename T>
	void operator & (T& data);

	template<>
	void operator & (int& data);

	template<>
	void operator & (bool& data);

	template<>
	void operator & (char& data);

	template<>
	void operator & (double& data);
	
	template<>
	void operator & (short& data);

	template<>
	void operator & (std::string& data);
	
	template<>
	void operator & 
	ArchiveImplBase(Stream& ss);

private:
	SERIALIZE_DIRECTION m_SerializeDirection;
	Stream&		m_Stream;
};
#endif